{% from "macros/pagination.html" import pagination %}

{% if query.total > 0 %}
  <div>
    {{ pagination(query, current_url, current_page) }}
    <table class="data-table">
      <thead>
        <tr>
          <th scope="col" class="crash-id">Crash ID</th>
          <th scope="col">Comment</th>
          <th scope="col">Date</th>
          <th scope="col">Locale</th>
        </tr>
      </thead>
      <tbody>
        {% for crash in query.hits %}
          <tr>
            <td>
              <a href="{{ url('crashstats:report_index', crash.uuid) }}" class="external-link crash-id">
                {{ crash.uuid }}
              </a>
            </td>
            <td>
              {{ crash.user_comments }}
            </td>
            <td>
              {{ crash.date | human_readable_iso_date }}
            </td>
            <td>
              {{ crash.useragent_locale }}
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
    {{ pagination(query, current_url, current_page) }}
  </div>
{% else %}
  <p>No comments were found.</p>
{% endif %}
